package com.webchat.common.enums.payment;

import com.webchat.common.enums.WalletTransTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author 程序员七七， https://www.coderutil.com网站作者
 * @date 2024/11/9 03:53
 *
 *
 * event设计目的：
 *      将降级从事件维度划分为几大类，便于后续数据的统计分析 ===> 例如基于event可以实现用户账单（出行、购物……）
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum PaymentTransEventEnum {

    SYSTEM_GRANT(1, "系统发放"),

    RED_PACKET(2, "红包"),

    SHOPPING(3, "购物"),

    TRAVEL(4, "出行"),

    FOOD(5, "美食"),

    OTHER(99, "其他"),
    ;

    private Integer transEvent;

    private String transEventName;


    public static String getEventName(Integer transEvent) {
        for (PaymentTransEventEnum event : PaymentTransEventEnum.values()) {
            if (event.transEvent.equals(transEvent)) {
                return event.transEventName;
            }
        }
        return "未知";
    }
}
